package com.example.insurance_service.controller;

import com.example.insurance_service.config.AjaxResult;
import com.example.insurance_service.domain.User;
import com.example.insurance_service.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("user")
@CrossOrigin
@Api("用户Controller")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("getList")
    @ApiOperation(value = "查询",notes = "无需参数")
    public AjaxResult getList(){
        List<User> list=userService.findAll();
        return AjaxResult.ok(list);
    }
}
